﻿package mortal.game.view.mount.panel
{
    import com.mui.controls.*;
    import com.mui.core.*;
    import com.mui.display.*;
    import com.mui.utils.*;
    import mortal.common.display.*;
    import mortal.component.gconst.*;
    import mortal.game.manager.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.item.*;

    public class EquipWinCellRenderer extends GCellRenderer
    {
        private var _packItem:EquipWinItem;

        public function EquipWinCellRenderer()
        {
            setSize(40, 40);
            return;
        }// end function

        override protected function initSkin() : void
        {
            var _loc_1:* = GlobalClass.getBitmap(BitmapDataConst.AlphaBMD);
            var _loc_2:* = ResourceConst.getScaleBitmap(ImagesConst.selectedBg);
            this.setStyle("downSkin", _loc_2);
            this.setStyle("overSkin", _loc_2);
            this.setStyle("upSkin", _loc_1);
            this.setStyle("selectedDownSkin", _loc_2);
            this.setStyle("selectedOverSkin", _loc_2);
            this.setStyle("selectedUpSkin", _loc_2);
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._packItem = UICompomentPool.getUICompoment(EquipWinItem);
            this._packItem.setItemStyle(ItemStyleConst.Small, ImagesConst.PackItemBg, 2, 2);
            this._packItem.x = 3;
            this._packItem.y = 3;
            this.addChild(this._packItem);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            this._packItem.dispose(param1);
            this._packItem = null;
            EffectManager.glowFilterUnReg(this);
            super.disposeImpl(param1);
            return;
        }// end function

        override public function set data(param1:Object) : void
        {
            super.data = param1;
            this._packItem.data = param1;
            if (param1["isMaxCombat"])
            {
                EffectManager.glowFilterReg(this);
            }
            else
            {
                EffectManager.glowFilterUnReg(this);
            }
            return;
        }// end function

    }
}
